<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>微信公众平台管理系统</title>
        <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">
    <include file="Public:header" />
    <!--[if IE]>
<script type="text/javascript" src="__PUBLIC__/js/excanvas.js"></script>
<![endif]-->
    <!--[if lt IE 9]>
      <script src="__PUBLIC__/js/html5.js"></script>
    <![endif]-->
    
</head>

<!--[if lt IE 7 ]> <body class="ie ie6"> <![endif]-->
<!--[if IE 7 ]> <body class="ie ie7 "> <![endif]-->
<!--[if IE 8 ]> <body class="ie ie8 "> <![endif]-->
<!--[if IE 9 ]> <body class="ie ie9 "> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<body class="">
    <!--<![endif]-->

    <!--顶部菜单-->
<include file="Public:navbar" />

<!--左侧导航条-->
<include file="Public:nav" />

<!--右侧整体区域-->
<div class="content">
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="row-fluid">

                <!--最近状态start-->
                <div class="block">
                    <a class="block-heading" data-toggle="collapse">最近状态</a>
                    <div class="block-body collapse in">

                        <div class="stat-widget-container">
                            <div class="stat-widget">
                                <div class="stat-button">
                                    <p class="title">{$subscribe_count}</p>
                                    <p class="detail">今日新关注用户数</p>
                                </div>
                            </div>

                            <div class="stat-widget">
                                <div class="stat-button">
                                    <p class="title">{$unsubscribe_count}</p>
                                    <p class="detail">今日取消关注数</p>
                                </div>
                            </div>

                            <div class="stat-widget">
                                <div class="stat-button">
                                    <p class="title">{$yesterday_subscribe_count}</p>
                                    <p class="detail">昨日新关注用户数</p>
                                </div>
                            </div>

                            <div class="stat-widget">
                                <div class="stat-button">
                                    <p class="title">{$yesterday_unsubscribe_count}</p>
                                    <p class="detail">昨日取消关注数</p>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
                <!--最近状态end-->


                <!--用户走势start-->
                <div class="block">
                    <a class="block-heading" data-toggle="collapse">用户走势</a>
                    <div class="block-body collapse in">

                        <div class="stat-widget-container">
                            
                            <div style="float:left;">
                                <canvas id="canvas" height="480" width="800"></canvas>
                            </div>
                            <div style="float: left;padding: 10px 10px;width: 200px;">
                                <p>图例</p>
                                <div style="clear: both;padding: 5px 0;"><div style="background-color: #97BBCD;width: 50px;height: 20px;float: left;"></div><div style="float: left;margin-left: 10px;">新关注用户</div></div>
                                <div style="clear: both;padding: 5px 0;"><div style="background-color: #DCDCDC;width: 50px;height: 20px;float: left;"></div><div style="float: left;margin-left: 10px;">取消关注用户</div></div>
                            </div>
                        </div>

                    </div>
                </div>
                <!--用户走势end-->

            </div>
            <footer>
                <include file="Public:footer" />
            </footer>
        </div>
    </div>
</div>
<script type="text/javascript" src="__PUBLIC__/js/Chart.min.js"></script>
<script type="text/javascript">
    $(function(){
        $.ajax({
            type: "POST",  //请求方式
            url: app_url+"/main/get_user_data",
            dataType:'json',  //返回数据类型
            cache:false,  //是否缓存
            timeout:10000, //超时时间
            success: function(data) {
                var lineData=eval(data);
                var myLine = new Chart(document.getElementById("canvas").getContext("2d")).Line(lineData,{scaleOverlay:true,scaleSteps:10,scaleStepWidth:1});
            },
            error:function(){
                alert('用户走势数据获取错误！');
            }
        });
    });
    
</script>
</body>
</html>


